package com.api.salary.FallBackFactory;
import com.api.salary.SalaryClient;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class SalaryService implements FallbackFactory<SalaryClient> {
    @Override
    public SalaryClient create(Throwable cause) {
      return  new SalaryClient() {
          @Override
          public String list() {
              System.out.println("Sentinel启动限流功能");
              return cause.getMessage();
          }

          @Override
          public void UpdateS(Long id, String name) {

          }
      };
    }
}